<?php $this->beginContent('//layouts/main'); ?>
<?php Yii::app()->clientScript->registerScript('search', "
$('.togglesidebar-button').click(function(){
    $('#sidebar').toggle(400);
    return false;
});
");
?>

<div class="block" id="content">
    <div class="column span-5">
        <div id="sidebar" class="dontprint">
	<?php Yii::app()->widgetCollapse->init(); ?>
        <?php
            $this->beginWidget('zii.widgets.CPortlet', array(
                'title'=>Yii::t('site','Operations'),
            ));
            
            $this->widget('zii.widgets.CMenu', array(
                'items'=>$this->menu,
                'htmlOptions'=>array('class'=>'operations'),
            ));
            $this->endWidget();
        ?>
        <?php $this->widget('ProjectWidget'); ?>
        <?php $this->widget('MilestoneWidget'); ?>
        <?php $this->widget('UserLogin',array('visible'=>Yii::app()->user->isGuest)); ?>
        <?php $this->widget('OnlineHelp'); ?>
        <?php $this->widget('UserMenu',array('visible'=>!Yii::app()->user->isGuest)); ?>
        <?php $this->widget('RecentPosts', array('maxPosts'=>3)); ?>
        <?php $this->widget('TagCloud',array('visible'=>$this->id=='post')); ?>
        </div><!-- sidebar -->
    </div>
    <div class="column span-1">
        &nbsp;
    </div>
    <div class="column span-18 last">
        <div>
            <?php if(isset($_SESSION['flash'])): // {{{ ?>
            <?php $cFlash = 0; foreach($_SESSION['flash'] as $flashType=>$messages) : ?>
            <?php foreach($messages as $message) : $flashID = ucfirst($flashType).'_'.$cFlash; ?>
            <div
                id="flash_<?php echo $flashID; ?>" 
                class="flash-<?php echo $flashType; ?>"
                style="display:none;float:left;">
                <table>
                    <tr valign="top">
                        <td style="padding-right:10px;width:40px;">
                            <?php $icon = $flashType=='error' ? 'Exclamation' : 'Information'; echo CHtml::image(
                                Yii::app()->baseUrl.'/images/icon' . $icon .'.png',
                                'Icon',
                                array('align' => 'top')
                            ); ?>
                        </td>
                        <td style="padding-right:10px;">
                            <?php echo $message; ?>
                        </td>
                        <td style="color:blue;font-size:1.2em;font-weight:bold;">
                            [<a href="#" title="<?php echo henc(_('Click to close this message box')); ?>" onclick="jQuery('#flash_<?php echo $flashID; ?>').hide('slow');">X</a>]
                        </td>
                    </tr>
                </table>
            </div>
            <div style="clear:left"></div>
            <script type="text/javascript">
            <!--
            jQuery("#flash_<?php echo $flashID; ?>").show("slow");
            // -->
            </script>
            <?php $cFlash++; endforeach; ?>
            <?php endforeach; ?>
            <?php endif; unset($_SESSION['flash']); // }}} ?>
        <?php if(Yii::app()->user->hasFlash('error')): // {{{ ?>
        <div
            id="flashError" 
            class="flash-error"
            style="display:none;float:left;">
          <table>
            <tr valign="top">
              <td style="padding-right:10px;width:40px;">
                <?php echo CHtml::image(
                    Yii::app()->baseUrl.'/images/iconExclamation.png',
                    'Exclamation Icon',
                    array('align' => 'top')
                  );
                ?>
              </td>
              <td style="padding-right:10px;">
                <?php echo Yii::app()->user->getFlash('error'); ?>
              </td>
              <td>
                <?php echo Yii::app()->user->getFlash('success'); ?>
              </td>
              <td style="color:blue;font-size:1.2em;font-weight:bold;">
              [<a href="#" title="<?php echo henc(_('Click to close this message box')); ?>" onclick="jQuery('#flashError').hide('slow');">X</a>]
              </td>
            </tr>
          </table>
        </div>
        <div style="clear:left"></div>
        <script type="text/javascript">
        <!--
        jQuery("#flashError").show("slow");
        // -->
        </script>
        <?php endif; // }}} ?>
            <?php if(Yii::app()->user->hasFlash('success')) : // {{{ ?>
            <div 
                id="flashSuccess" 
                class="flash-success"  
                style="display:none;float:left">
              <table>
                </tr>
                <tr valign="top">
                  <td style="padding-right:10px;width:40px;">
                    <?php echo CHtml::image(
                        Yii::app()->baseUrl.'/images/iconInformation.png',
                        'Info Icon',
                        array('align' => 'top')
                      );
                    ?>
                  </td>
                  <td style="padding-right:10px">
                    <?php echo Yii::app()->user->getFlash('success'); ?>
                  </td>
                  <td style="color:blue;font-size:1.2em;font-weight:bold;">
                  [<a href="#" title="<?php echo henc(_('Click to close this message box')); ?>" onclick="jQuery('#flashSuccess').hide('slow');">X</a>]
                  </td>
                </tr>
              </table>
            </div>
            <div style="clear:left"></div>
        <script type="text/javascript">
        <!--
        jQuery("#flashSuccess").show("slow");
        // -->
        </script>
            <?php endif; // }}} ?>
            <?php echo $content; ?>
        </div><!-- content -->
    </div>
</div>
<?php $this->endContent(); ?>
